package com.android.common.flutter;

import android.widget.Toast;
import com.android.common.R;
import com.android.common.adapter.holder.CommonTvHolder;
import com.android.common.constant.Constant;
import com.android.common.mvp.model.CodeMsgBean;
import com.android.common.utils.GsonUtil;
import io.flutter.plugin.common.EventChannel;

/**
 * EventChannel是一种native向flutter发送数据的单向通信方式，
 * flutter无法返回任何数据给native。
 * 主要用于native向flutter发送手机电量变化、网络连接变化、陀螺仪、传感器等
 */
public class BaseEventChannelStreamHandler implements EventChannel.StreamHandler {

   private static final BaseEventChannelStreamHandler mInstance = new BaseEventChannelStreamHandler();
   private EventChannel.EventSink mEventSink;

   public static BaseEventChannelStreamHandler getInstance() {
      return mInstance;
   }

   public EventChannel.EventSink getEventSink() {
      return mEventSink;
   }

   @Override
   public void onListen(Object arguments, EventChannel.EventSink events) {
      mEventSink = events;
   }

   @Override
   public void onCancel(Object arguments) {

   }
}
